Imports DAL
Imports MyClasses

Public Class BSalePrint
    'WRITTEN BY:-
    '
    '

    Public Shared Function GetAmount(ByVal taxCalc As CtaxCalculation) As Double
        Dim dblTotalDisc As Double
        Dim dblTotalTax As Double
        Dim dblBalance As Double

        With taxCalc
            If .DiscType = "A" Then
                dblTotalDisc = .TotalVal - .DiscountVal                       'Calculate Total after giving discount in Amount
            Else
                dblTotalDisc = .TotalVal - (.TotalVal * .DiscountVal) / 100      'Calculate Total after giving discount in Percentage
            End If

            dblTotalTax = dblTotalDisc + (dblTotalDisc * .TaxVal) / 100                      'Calculate Tax on Discount Amount 
            dblTotalTax = dblTotalTax - .DebitVal
            dblTotalTax = dblTotalTax + .CreditVal

            taxCalc.GrossAmount = Format(dblTotalTax, "0.00")

            dblBalance = dblTotalTax - .PaidVal

            Return dblBalance

        End With
    End Function

    Public Shared Function GetCustomerData(ByVal CustID As Integer) As DataTable
        Return DSalePrint.GetCustomerData(CustID)
    End Function

    Public Shared Function GetCustomerPrintBills(ByVal CustID As Integer) As DataTable
        Return DSalePrint.GetCustomerPrintBills(CustID)
    End Function

    Public Shared Function GetBillItems(ByVal SaleID As Integer) As DataTable
        Return DSalePrint.GetBillItems(SaleID)
    End Function

    Public Shared Function GetCustomerFinalBills(ByVal CustID As String) As DataTable
        Return DSalePrint.GetCustomerFinalBills(CustID)
    End Function

    Public Shared Function GetDoctor(ByVal CustID As String) As DataTable
        'Selecting Record of Particular Customer
        Return DSalePrint.GetDoctor(CustID)
    End Function

    Public Shared Function GetPrintCriteria(ByVal PrintType As String) As DataTable
        'Fetching the Print Document Setting Criteria
        Return DSalePrint.GetPrintCriteria(PrintType)
    End Function

    '@20072412 : Add new function to get customer Name
    Public Shared Function GetCustomerName(ByVal CustId As Integer) As DataTable
        Return DSalePrint.GetCustomerName(CustId)
    End Function

    '@20072412 : Add new function to get Doctor Name
    Public Shared Function GetDoctorList(ByVal DoctID As Integer) As DataTable
        Return DSalePrint.GetDoctorList(DoctID)
    End Function

    'Written By:-(2008/01/03) :- Selecting The FooterInfo 
    Public Shared Function FooterInfo() As DataTable
        Return DSalePrint.FooterInfo()
    End Function

End Class
